#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int trap_number(int n)
{
	int sum = 0, m;
	while (n)
	{
		sum += n % 10;  //从低位到高位逐个截取数字
		n /= 10;  //丢掉最低位
	}

	m = 3 * sum + 1;
	return m;
}

int main()
{
	int n, t, count = 1;
	scanf("%d", &n);

	while (1)
	{
		t = trap_number(n);
		printf("%d:%d\n", count, t);
		count++;

		if (t == n)
			break;

		n = t;  //将变换完后的自然数赋值给n,进行下一次变换
	}
	return 0;
}